<template>
	<view class="item">
		<view class="left">
			<image :src="item.goods_small_logo || defualtImg" mode=""></image>
			
		</view>
		<view class="right">
			<view class="title">
				{{item.goods_name}}
				
			</view>
			<view class="price">
				¥{{ item.goods_price | toFixed }}
			</view>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"my-goods",
		props:['item'],
		data() {
			return {
				// 设置默认图片
				defualtImg:'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
			};
		},
		filters:{
			// 处理价格的后缀
			toFixed(price){
				return price.toFixed(2)
			}
		},
		
	}
</script>

<style lang="scss">
	.item{
		display: flex;
		padding: 40rpx 20rpx;
		border-bottom: 1px solid #c0c0c0;
		.left{
			image{
				width: 200rpx;
				height: 200rpx;
				margin-right: 20rpx;
			}
			
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.title{
				font-size: 12px;
			}
			.price{
				font-size: 14px;
				color: #c01720;
			}
		}
	  
	}

</style>